import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ExportBillDetailVO, ExportBillDetailForm, ExportBillDetailQuery } from '@/api/warehouse/exportBillDetail/types';

/**
 * 查询出库单明细列表
 * @param query
 * @returns {*}
 */

export const listExportBillDetail = (query?: ExportBillDetailQuery): AxiosPromise<ExportBillDetailVO[]> => {
  return request({
    url: '/warehouse/exportBillDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询出库单明细详细
 * @param id
 */
export const getExportBillDetail = (id: string | number): AxiosPromise<ExportBillDetailVO> => {
  return request({
    url: '/warehouse/exportBillDetail/' + id,
    method: 'get'
  });
};

/**
 * 新增出库单明细
 * @param data
 */
export const addExportBillDetail = (data: ExportBillDetailForm) => {
  return request({
    url: '/warehouse/exportBillDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改出库单明细
 * @param data
 */
export const updateExportBillDetail = (data: ExportBillDetailForm) => {
  return request({
    url: '/warehouse/exportBillDetail',
    method: 'put',
    data: data
  });
};

/**
 * 删除出库单明细
 * @param id
 */
export const delExportBillDetail = (id: string | number | Array<string | number>) => {
  return request({
    url: '/warehouse/exportBillDetail/' + id,
    method: 'delete'
  });
};
